import request from '@/utils/request';

// 分页查询
export function page(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/channel/page',
		method: 'post',
		data: data,
	});
}

// 新增
export function save(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/channel/save',
		method: 'post',
		data: data,
	});
}

// 修改
export function updateById(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/channel/updateById',
		method: 'put',
		data: data,
	});
}

// 删除
export function removeByIds(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/channel/removeByIds/' + data,
		method: 'delete',
	});
}

// 导入渠道
export function importChannel(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/channel/import',
		method: 'post',
		data: data,
	});
}

// 下载渠道导入模板
export function downloadTemplate(): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/channel/downloadTemplate',
		method: 'get',
		responseType: 'blob',
	});
}
